<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:c="http://java.sun.com/jsp/jstl/core">
    <f:loadBundle  basename="resources.caption" var="caption"/>
    <h:head>
        <title>Facelet Title</title>
    </h:head>
    <h:body   style="font-size: 10px;border-spacing: 0;margin: 0;">
        <f:view>
                  <!--<h:form id="frmMain">  -->
            <style type="text/css">
.footer .ui-layout-unit-content {
   background-color: red !important;
}

.content .ui-layout-container{
overflow: auto !important;


}


</style>
             
           <p:layout fullPage="true">
               <p:layoutUnit id="layoutNorth" position="north" size="60" >  
                <h:outputText value="Top unit content." />  
                <input type="text" id="txt_count" name="txt_count"/>
            </p:layoutUnit>  

               <p:layoutUnit id="layoutSouth" position="south" size="50">  
                <h:outputText value="South unit content." />
            </p:layoutUnit>  
<p:layoutUnit position="west" size="200" header="Left Menu" resizable="true" collapsible="true">  
   <!-- <p:menu model="#{menuBean.model}"></p:menu> -->
    
                
    <p:accordionPanel id="accordionMenu" value="#{menuBean.listModule}" var="modul" >
                        <p:tab title="#{modul.modulName}" >
                            <ui:repeat value="#{modul.menuList}" var ="itemNode" >
                                <h:form>
                                <p:commandLink  actionListener="#{menuBean.addTab}" update="tabViewMenu"> #{itemNode.title}
                                
        
                                <f:param name="val" value="2"></f:param>
                                <f:param name="title" value="#{itemNode.title}"></f:param>
                                <f:param name="id" value="#{itemNode.id}"></f:param>
                                <f:param name="url" value="#{itemNode.url}"></f:param>
                                </p:commandLink> 
                                    </h:form>
                                <br/>
                            </ui:repeat>
                        </p:tab>                       
                    </p:accordionPanel>
                    
              
            </p:layoutUnit>  
               <p:layoutUnit id="layoutCenter" position="center" >                 
    <!--<p:commandLink   
        actionListener="#{menuBean.increment}" update=":frmMain:txt_count :frmMain:tabViewMenu"> #{caption.btnSave} Counte2
        <f:param name="val" value="2"></f:param>        
    </p:commandLink> -->
     
    <p:panel  id="mainPanel">
    
        <p:tabView id="tabViewMenu" rendered="true" cache="true" activeIndex="#{menuBean.tabActiveIndex}">
       <p:ajax event="tabClose" listener="#{menuBean.onClose}" /> 
        
        <c:forEach items="#{menuBean.showTabs}" var="menu" varStatus="loop">
                   
                   <p:tab id="tab#{loop.count}" title="#{menu.title}" closable="true" >  
                          <ui:include src="#{menu.url}" ></ui:include>
                       <!--<p:scrollPanel style="width:100%;height:430px">
                           <h:panelGroup rendered="true" style="width:100%;height:430px">
                           <c:choose>
                               <c:when test="#{menu.url!=null}">
                                   <ui:insert name="myView">
                                   <ui:include src="#{menu.url}" ></ui:include>
                                   </ui:insert>
                               </c:when>
                               <c:otherwise>
                                   <ui:include src="master/buslic.xhtml" ></ui:include>    
                                </c:otherwise>
                           </c:choose> 
                           
                       </h:panelGroup>
                      </p:scrollPanel> -->
                        </p:tab>     
                      
        </c:forEach>
                      </p:tabView> 
       </p:panel>
                   </p:layoutUnit>  
               </p:layout>

            </f:view>
    </h:body>
</html>

